package com.neuedu.projectedu.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.neuedu.projectedu.common.Result;
import com.neuedu.projectedu.entity.Menu;
import com.neuedu.projectedu.service.MenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping
    public Result getMenus(){
        List<Map> menuList=menuService.getMenus();
        return Result.success(menuList);
    }
}
